package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `json:"username"`
	Password string `json:"password"`
}
type Book struct {
	gorm.Model
	Title        string `json:"title"`
	Content      string `json:"content"`
	UserId       int    `json:"user_id"`
	User         User
	CommentCount int `json:"comment_count"`
}
type Comment struct {
	gorm.Model
	UserId int  `json:"user_id"`
	BookId int  `json:"book_id"`
	User   User `gorm:"foreignKey:UserId"`
	Book   Book `gorm:"foreignKey:BookId"`
}
